Skip to content

matrix: check scheme in Server before use it to replace mxc#139

Open
mohan43u wants to merge 1 commit intomatterbridge-org:masterfrom
mohan43u:matrix-mxc-replace-scheme-fix
Open

matrix: check scheme in Server before use it to replace mxc#139
mohan43u wants to merge 1 commit intomatterbridge-org:masterfrom
mohan43u:matrix-mxc-replace-scheme-fix

Conversation

@mohan43u
Copy link
Copy Markdown

make sure we include default https:// scheme if the "Server" configuration variable don't contain a scheme during replacing mxc:// to download media content

make sure we include default https:// scheme if the "Server"
configuration variable don't contain a scheme during
replacing mxc:// to download media content
@selfhoster1312
Copy link
Copy Markdown
Collaborator

selfhoster1312 commented Feb 19, 2026

Hello, i'm curious what your configuration is since other people use the matrix bridge and have not reported this problem.

Is it possible that you're using Server="domain" instead of Server="https://domain" by any chance? If so, we should probably error out on start in that case instead of adding workarounds further down.

What do you think?

@mohan43u
Copy link
Copy Markdown
Author

Is it possible that you're using Server="domain" instead of Server="https://domain" by any chance?

Yes, I was using Server=matrix.org and got error invalid scheme "", If I used Server=https://matrix.org, I would have never got this error.

we should probably error out on start in that case instead of adding workarounds further down

I don't know what is the correct way of specifying Server, Enforcing proper URL or just specifying domain is upto the maintainers.

@selfhoster1312
Copy link
Copy Markdown
Collaborator

I don't know what is the correct way of specifying Server

I think it's more correct to always specify the scheme. Because localhost tests are probably http://localhost, and real-world scenarios are usually https://example.com. But some real-world scenarios may take place over HTTP when there's a cryptographically-secure tunnel such as http://ABCDEF.onion.

To be fair, matrix runs over HTTP and in the web world, https is nowadays always implied by default. Therefore an alternative could be, instead of erroring, that when we start the bridge, if the Server URL has no scheme, override it with https:// before reaching other parts of the code.

Other opinions welcome :)

@poVoq
Copy link
Copy Markdown
Collaborator

poVoq commented Feb 20, 2026

Well, either we make it very clear in the examples and documentation that the scheme is required, or a fallback like this is nice to add. For Matrix there are probably no edge cases where https:// would not be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants